<template>
	<div class="container-full">
		<div class="regedit-head">
			<h1 class="title">修改业务员信息</h1>
		</div>
		<div class="normal-form-container bottom-ash-line">
			<!-- <van-field type="tel" v-model="forma.phone" placeholder="请输入手机号（登陆账号）" :error-message="errorMsg.phone" /> -->
			<!--<van-field v-model="forma.name" :error-message="errorMsg.name" placeholder="请输入用户名" />-->
			<van-field v-model="forma.password" type="password" placeholder="请输入新密码" />
			<van-field v-model="forma.repassword" type="password" placeholder="请确认新密码" />
		</div>
		<!-- <div class="normal-form-container">
			<van-field v-model="forma.realname" placeholder="请输入联系人姓名" :error-message="errorMsg.realname" class="el-mt-10" />
		</div> -->
		<div class="normal-form-button-container el-mt-30">
			<van-button type="primary" size="large" @click="eventClickOperate" class="green-background font-size-17 edge-angle-normal">提交修改</van-button>
		</div>
	</div>
</template>

<style lang="scss" scoped>
	.regedit-head {
		margin: 3.2rem 1.1rem 1.1rem;
		font-size: 1.6rem;

		display: flex;
		justify-content: space-between;
		align-items: flex-end;

		.title {
			margin: 0rem;
			padding: 0rem;
		}

		.info-tip {
			color: #666666;
			font-size: 1.4rem;
			padding-right: 1rem;
			position: relative;
		}
		.info-tip::after {
			content: "";
			display: block;
			width: 1rem;
			position: absolute;
			top: 0rem;
			bottom: 0rem;
			right: 0rem;
			background-image: url("../../../static/images/arrow-right-ash.png");
			background-repeat: no-repeat;
			background-position: center right;
			background-size: 50% 50%;
		}
	}

	.check-button {
		padding-left: 2rem !important;
		padding-right: 2rem !important;
		background-color: #ccffcc;
		color: #00cc00;
		font-size: 1.3rem;
	}

	.map-button {
		background-color: #00cc00;
		color: #ffffff;
		padding-left: 2rem !important;
		padding-right: 2rem !important;
		font-size: 1.3rem;
	}
</style>

<script>
	import { Field, CellGroup, Button, Toast, Popup, Area } from 'vant';

	export default {
		name: 'ShopIndex',
		components: {
			[Field.name]: Field, [CellGroup.name]: CellGroup, [Button.name]: Button, [Area.name]: Area, [Popup.name]: Popup
		},
		data() {
			return {
				forma: {
					password: '',
					repassword: ''
				}
			}
		},
		created() {
			// this.validator = validator(this.rules, this.forma);
		},
		mounted() {
			console.log(this.$route.params);
		},
		methods: {
			eventClickOperate() {
				if (this.forma.password == this.forma.repassword) {
					let params = {
                            id: this.$route.params.oda.id,
                            pwd: this.forma.password
                        };
                    
					this.$util.postRequestInterface('/api/home/user/change', params, (res) => {
						this.$router.go(-1);
					});
				} else {
                    this.$toast('二次密码输入不一致');
				}
			}
		}
	}
</script>
